package com.wc.trainTest.行走的行人;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/1/26 14:53
 * @description 行走的行人
 * https://acm.creative3605.com/contest/68/problem/J
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
//    static int N = (int) 1e9 + 10;
    static int n;
    // 左边的右，右边的左
//    static int[][] m = new int[N][2];
    // num[i] i = 0 表示左右都没有, i = 1 表示只有左边 i = 2 表示只有右边 i = 3 表示左右都有了
//    static int[] num = new int[N];

    public static void main(String[] args) {
        Map<Integer, int[]> map = new HashMap<>();

        n = sc.nextInt();
        Node[] a = new Node[n];
        for (int i = 0; i < n; i++) {
            Node node = new Node();
            a[i] = node;
            node.y = sc.nextInt();
            node.x = sc.nextInt();
        }
        String s = sc.next();

        for (int i = 0; i < n; i++) {
            char op = s.charAt(i);
            int x = a[i].x;
            int[] m;
            if (map.containsKey(x)) {
                m = map.get(x);
            } else {
                m = new int[3];
                map.put(x, m);
            }
            if (op == 'L') {
                if (m[2] == 0 || m[2] == 1) {
                    m[1] = a[i].y;
                    m[2] += 2;
                } else {
                    m[1] = Math.max(m[1], a[i].y);
                }
            } else {
                if (m[2] == 0 || m[2] == 2) {
                    m[0] = a[i].y;
                    m[2] += 1;
                } else {
                    m[0] = Math.min(m[0], a[i].y);
                }
            }
            if (m[2] == 3) {
                if (m[0] < m[1]) {
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
    }


    static class Node {
        int x;
        int y;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}